package com.eorchis.module.trainingquestionnaire.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.module.basedata.domain.BaseData;
import com.eorchis.module.department.domain.Department;
import com.eorchis.module.user.domain.User;

/**
 * Title: Questionnaire<br>
 * Description: 调查问卷实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author Administrator
 * @createDate 2014-08-27
 * @version $Revision$
 */
@Entity
@Table(name = "QUESTIONNAIRE")
public class QuestionnaireEntity implements IBaseEntity {
	private static final long serialVersionUID = 1L;
	/**
	 * 已发布
	 */
	public static final Integer IS_PUBLISH_Y=new Integer(1);
	/**
	 * 未发布
	 */
	public static final Integer IS_PUBLISH_N=new Integer(2);
	
	/**
	 * 已活动
	 */
	public static final Integer ACTIVE_STATE_Y=new Integer(1);
	/**
	 * 未活动
	 */
	public static final Integer ACTIVE_STATE_n=new Integer(2);

	private String questionnaireId;//ID
	private String questionnaireName;//名称
	private BaseData questionnaireType;//类型
	private Integer surveyObjectType;//类型
	private Date beginDate;//日期
	private Date endDate;//日期
	private User user;//创建人id
	private Department department;//创建部门id
	private Integer surveyType;//调查方式
	private String questionnaireExplain;//edu说明
	private Integer publishState;//状态
	private Integer activeState;//活动状态
	private Date createDate;//创建日期
	
	/**
	 * 获取ID
	 */	
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="QUESTIONNAIRE_ID")
	public String getQuestionnaireId() {
		return questionnaireId;
	}
	/**
	 * 设置ID
	 */		
	public void setQuestionnaireId(String questionnaireId) {
		this.questionnaireId = questionnaireId;
	}
	/**
	 * 获取名称
	 */	
	@Column(name="QUESTIONNAIRE_NAME")
	public String getQuestionnaireName() {
		return questionnaireName;
	}
	/**
	 * 设置名称
	 */		
	public void setQuestionnaireName(String questionnaireName) {
		this.questionnaireName = questionnaireName;
	}
	/**
	 * 获取类型
	 */	
	@ManyToOne(fetch = FetchType.EAGER, optional = true )
	@JoinColumn(name="QUESTIONNAIRE_TYPE",referencedColumnName="DATA_CODE")
	public BaseData getQuestionnaireType() {
		return questionnaireType;
	}
	/**
	 * 设置类型
	 */		
	public void setQuestionnaireType(BaseData questionnaireType) {
		this.questionnaireType = questionnaireType;
	}
	/**
	 * 获取类型
	 */	
	@Column(name="SURVEY_OBJECT_TYPE")
	public Integer getSurveyObjectType() {
		return surveyObjectType;
	}
	/**
	 * 设置类型
	 */		
	public void setSurveyObjectType(Integer surveyObjectType) {
		this.surveyObjectType = surveyObjectType;
	}
	/**
	 * 获取日期
	 */	
	@Column(name="BEGIN_DATE")
	@Temporal(TemporalType.DATE)
	public Date getBeginDate() {
		return beginDate;
	}
	/**
	 * 设置日期
	 */		
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	/**
	 * 获取日期
	 */	
	@Column(name="END_DATE")
	@Temporal(TemporalType.DATE)
	public Date getEndDate() {
		return endDate;
	}
	/**
	 * 设置日期
	 */		
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	/**
	 * 获取创建人id
	 */
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="USERID")
	public User getUser() {
		return user;
	}
	/**
	 * 设置创建人id
	 */		
	public void setUser(User user) {
		this.user = user;
	}
	/**
	 * 获取创建部门id
	 */
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="DEPID")
	public Department getDepartment() {
		return department;
	}
	/**
	 * 设置创建部门id
	 */		
	public void setDepartment(Department department) {
		this.department = department;
	}
	/**
	 * 获取类型
	 */	
	@Column(name="SURVEY_TYPE")
	public Integer getSurveyType() {
		return surveyType;
	}
	/**
	 * 设置类型
	 */		
	public void setSurveyType(Integer surveyType) {
		this.surveyType = surveyType;
	}
	/**
	 * 获取edu说明
	 */	
	@Column(name="QUESTIONNAIRE_EXPLAIN")
	public String getQuestionnaireExplain() {
		return questionnaireExplain;
	}
	/**
	 * 设置edu说明
	 */		
	public void setQuestionnaireExplain(String questionnaireExplain) {
		this.questionnaireExplain = questionnaireExplain;
	}
	/**
	 * 获取状态
	 */	
	@Column(name="PUBLISH_STATE")
	public Integer getPublishState() {
		return publishState;
	}
	/**
	 * 设置状态
	 */		
	public void setPublishState(Integer publishState) {
		this.publishState = publishState;
	}
	/**
	 * 活动状态
	 */
	@Column(name="ACTIVE_STATE")
	public Integer getActiveState() {
		return activeState;
	}
	public void setActiveState(Integer ActiveState) {
		activeState=ActiveState;
	}
	/**
	 * 创建日期
	 */
	@Column(name="CREATE_DATE")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
}
